package StudyCode.summary.mycollection;

import java.util.ArrayList;
import java.util.Collections;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class SortElementsOfArrayList {
	public static void main(String[] args) {
		ArrayList arrayList = new ArrayList();
		arrayList.add("1");
		arrayList.add("3");
		arrayList.add("5");
		arrayList.add("2");
		arrayList.add("4");

		Collections.sort(arrayList);

		System.out.println("升序排序后的ArrayList元素: ");
		for (int i = 0; i < arrayList.size(); i++)
			System.out.println(arrayList.get(i));
	}
}
